import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/manage/HomeView.vue'
import LoginView from "@/views/LoginView";
import HomeIndexView from "@/views/manage/HomeIndexView";
import AboutView from "@/views/manage/AboutView"
import productTypeRouter from "@/router/productType";
import supplierRouter from "@/router/supplier";
import supplierEnterRuleRouter from "@/router/supplierEnterRuleRouter";
import warehouseRouter from "@/router/warehouse";
import messagesRouter from "@/router/messages";
import purchaseTypeRouter from "@/router/purchase";
import productCategoryRouter from "@/router/productCategory";
import supplierDeliverPersonRouter from "@/router/supplierDeliverPerson";
import supplierSignRouter from "@/router/supplierSign";
import purchaseOrderRouter from "@/router/purchaseOrder";
import purchaseNeedPoolRouter from "@/router/purchaseNeedPool"
import suppliersamplemanagementRouter from "@/router/suppliersamplemanagement";
import supplierDeliverGoodsRouter from "@/router/supplierDeliverGoods";
Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name: 'login',
        component: LoginView
    },
    {
        path: '/manage',
        name: 'home',
        component: HomeView,
        children: [
            {
                path: '',
                name: 'manageindex',
                component: HomeIndexView
            },
            {
                path: '/manage/about',
                name: 'about',
                component: AboutView
                // route level code-splitting
                // this generates a separate chunk (about.[hash].js) for this route
                // which is lazy-loaded when the route is visited.
                //component: () => import(/* webpackChunkName: "about" */ '../views/manage/AboutView.vue')
            },
            ...productTypeRouter,
            ...supplierRouter,
            ...supplierEnterRuleRouter,
            ...supplierDeliverPersonRouter,
            ...supplierDeliverGoodsRouter,
            ...supplierSignRouter,
            ...warehouseRouter,
            ...messagesRouter,
            ...productCategoryRouter,//产品分类Router
            ...purchaseTypeRouter,
            ...purchaseOrderRouter,
            ...purchaseTypeRouter,
            ...suppliersamplemanagementRouter,
            ...purchaseNeedPoolRouter,

        ]
    },
]

const router = new VueRouter({
    routes
})

export default router
